﻿Imports System.Windows.Forms

Public Class FileView
    Inherits TreeView
    Private components As System.ComponentModel.IContainer
    Friend WithEvents FileBrowserImageList As System.Windows.Forms.ImageList


    Public Sub New()
        InitializeComponent()

        Me.ImageList = FileBrowserImageList
        Me.Font = New Font("Segoe UI", 9.5)
        Me.Indent = 5

    End Sub

    Public Enum FileViewMode
        CLASSIC
        CONTEMPORARY
        MODERN
    End Enum

    Private _fileviewmode As FileViewMode = FileViewMode.CLASSIC
    Public Property FileViewType As FileViewMode
        Get
            Return _fileviewmode
        End Get
        Set(ByVal value As FileViewMode)
            _fileviewmode = value
            If value = FileViewMode.CLASSIC Then
                ShowLines = True
                ShowPlusMinus = True
                ShowRootLines = True
            ElseIf value = FileViewMode.CONTEMPORARY Then
                ShowLines = True
                ShowPlusMinus = False
                ShowRootLines = False
            ElseIf value = FileViewMode.MODERN Then
                ShowLines = False
                ShowPlusMinus = False
                ShowRootLines = False
            End If

            Globals.UISettings.SetTrait("FileViewType", value.ToString())
        End Set
    End Property

    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FileView))
        Me.FileBrowserImageList = New System.Windows.Forms.ImageList(Me.components)
        Me.SuspendLayout()
        '
        'FileBrowserImageList
        '
        Me.FileBrowserImageList.ImageStream = CType(resources.GetObject("FileBrowserImageList.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.FileBrowserImageList.TransparentColor = System.Drawing.Color.Transparent
        Me.FileBrowserImageList.Images.SetKeyName(0, "project_open.png")
        Me.FileBrowserImageList.Images.SetKeyName(1, "document_open_folder.png")
        Me.FileBrowserImageList.Images.SetKeyName(2, "document_properties.png")
        '
        'FileView
        '
        Me.LineColor = System.Drawing.Color.Black
        Me.ResumeLayout(False)

    End Sub
End Class
